/*
 * @Author: Bennent_G
 * @Date: 2024-12-25 15:48:39
 * @LastEditTime: 2024-12-25 16:48:10
 * @Description: 自定义通知
 */
import { notification } from 'ant-design-vue';
export function useCustomNotification() {
	const [api, contextHolder] = notification.useNotification();

	const openNotifation = ({
		type ='info',
		message,
		description,
		placement = 'topRight',
	}: {
		type?: 'info' | 'success' | 'error' | 'warning';
		message: string;
		description?: string;
		placement?: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
	}) => {
		console.log('openNotifation', message);
		api.open({
			type,
			message,
			description,
			placement,
		});
	};

	return {
		contextHolder,
		openNotifation
	};
}
